<{include file="public/header.html"}>
<link rel="stylesheet" href="<{$style_dir}>/js/vendor/simditor/font-awesome.css" />
<script type="text/javascript" src="<{$style_dir}>/js/vendor/simditor/simditor.js"></script>
	<!--发帖单页面-->
	<div class="w1180-con mt20">
		<div class="post-article fl w840">
			<div class="title">
				<p class="title-big">文章标题</p>
				<div class="title-box">
                                    <input type="text" name="articles_title" id="articles_title" placeholder="标题不少于10个字哦" maxlength="70" value="<{$item['title']}>"/>
				</div>
                                <i class="mt5"><span class="title-count error">0</span>/50&nbsp;字</i>
			</div>
			<div class="con mt20">
				<p class="title-big">文章内容</p>
				<div class="con-box" style="width:840px;min-height:">
                                    <textarea id="articles_content" name="articles_content" placeholder="请在这里输入您的文章内容" autofocus><{$item['content']}></textarea>
				</div>
				<i class="mt5"><span class="content-count error">0</span>&nbsp;字</i>
			</div>
                    <script type="text/javascript">
                        $(function() {
                            var $preview, editor, mobileToolbar, toolbar;
                            Simditor.locale = 'zh-CN';
                            toolbar = ['title', 'bold', 'italic', 'underline', 'strikethrough', 'fontScale', 'color', '|', 'blockquote', '|', 'link', 'image', 'hr', '|','alignment'];
                            var editor = new Simditor({
                                textarea: $('#articles_content'),
                                toolbar: toolbar,
                                pasteImage: true,
                            });
                        });
                    </script>
			<div class="classification mt20">
				<p class="mb10">选择版块</p>
                                <ul id="art_cates_box" data-flag="0">
                                    <{foreach from=$cates key=key item=val}>
                                    <li <{if $item['cat_id'] == $val['id']}>class='on'<{/if}>>
                                            <a href="javascript:void(0);" date-id="<{$val['id']}>"><{$val['name']}></a>
					</li>
                                    <{/foreach}>
				</ul>
				<div class="clear"></div>
			</div>
			<div class="label mt20">
				<p class="mb10">文章标签</p>
                                <div class="label-list" id="art_tags_box">
                                    <{foreach from=$item['tags'] key=key item=val}>
                                    <a href="javascript:void(0);" data-name="<{$val}>" data-tid="<{$key}>" class="on"><{$val}></a>
                                    <{/foreach}>
				</div>
				<span class="fl add-btn mr10" style="margin-top: 1px;">+</span>
				<div class="label-input fl">
					<input type="text" name="key_tag" id="seach_art_key_tag" placeholder="添加标签" />
                                        <div class="input-all bjf" id="seach_art_tag_box" style="display:none;">
					</div>
				</div>
				<div class="clear"></div>
                                <div id="art_tags_error" style="display:none;"><label class="error f12">我们只接受5个标签哦~</label></div>
			</div>
			<div class="tip-mail mt30">
                            <div class="checkbox <{if $item['is_email_noitce']}>active<{/if}>" id="email_notice_select"></div>
                            收到评论后邮箱提醒我<{if $user_email}><a href="<{eval finance_url('user/security')}>change-email" target="_blank"><{$user_email}>（更改）</a><{else}><a href="<{eval finance_url('user/security')}>#change-email" target="_blank">（还没有绑定邮箱去设置）</a><{/if}>
			</div>
			<div class="post-btn mt20">
                            <input class="release fr ml20 _T_art_modify" type="submit" value="确认发布" data-action-url="<{eval url('post/modify')}>" data-unvalid="发布中..." data-aid="<{$item['article_id']}>"/>
			</div>
		</div>
		<{include file="post/right.html"}>
		<div class="clear"></div>
	</div>
        <div class="popup-draft bjf popup-box" id="draft_box_window">
            <div class="title-big p20">
                我的草稿箱&nbsp;&nbsp;&nbsp;<span class="error del-box-show" style="display:none;"></span>
                    <a href="javascript:void(0);" class="fr close popup-close">×</a>
            </div>
            <ul id="draft_box_list">
            </ul>
            <div class="pages fr" id="draft_pagination">
            </div>
            <div class="clear"></div>
	</div>
	<div class="popup-invitation bjf">
		<div class="title-big p20">
			这些小伙伴回答问题都很溜
			<a href="javascript:void(0);" class="fr close">×</a>
		</div>
		<ul>
			<li>
				<a href="javascript:void(0);" class="head">
					<img src="<{$style_dir}>/temp/111.jpg"/>
				</a>
				<a href="javascript:void(0);" class="name">Hska</a>
				<a href="javascript:void(0);" class="btn">邀请回答</a>
			</li>
		</ul>
	</div>
    
    <script type="text/javascript">
        $(function(){
            if('<{$login}>' == '1'){
                showLogin('login');return;
            }else{
                if('<{$mobile}>'=='0'){
                    layer.msg("发帖前请到官网个人中心填写手机号!",{icon:0,offset:300,time:2000},function(){window.location.href='/user/security.html#change-phone'});
                }else{
                    if("<{$cate_code}>" == "" || "<{$sec_cate_code}>" == "" ){
                        $(".popup-post").fadeIn();
                        $(".popup").fadeIn();
                    }
                }
            }
            $('.post-article .label .add-btn').on('click',function(){
                $(this).parents('.label').find('.label-input').toggle(500);
            });
            $('.post-article .tip-mail .checkbox').on('click',function(){
                $(this).hasClass('active') ? $(this).removeClass('active') : $(this).addClass('active');
            });
        });
    </script>
    <script type="text/javascript" src="<{$style_dir}>/js/post.article.js"></script>
<!--底部-->
<{include file="public/footer.html"}>